import 'package:flutter/services.dart';

class UnicomBasicMessageChannel {
  final String channelName;
  BasicMessageChannel channel;

  UnicomBasicMessageChannel(this.channelName) : channel = BasicMessageChannel(channelName, const StandardMessageCodec());

  Future callNative(dynamic args) {
    return channel.send(args);
  }

  // ignore: use_function_type_syntax_for_parameters
  setListener(Future<dynamic> handler(dynamic)) {
    channel.setMessageHandler(handler);
  }
}
